Skip to content

Instantly share code, notes, and snippets.

Avatar

Ashim Lamichhane ashim888

View GitHub Profile
View batting.via
'automatical movement based on mathematical formulas.....
'(c) fbr@vizrt.com
dim target as container = Scene.FindContainer("Result")
sub OnInitParameters()
'create the GUI
RegisterParameterString("url", "URL:","http://cricket.yarsha.net", 50,255, "")
View gist:027e8ccb2001986f6bbb25b7d871a08c
Verifying my Blockstack ID is secured with the address 12VR5CPymXjkW6hXqppZ59x334eHDCG9Bs https://explorer.blockstack.org/address/12VR5CPymXjkW6hXqppZ59x334eHDCG9Bs
@ashim888
ashim888 / cors.inc
Created Apr 13, 2018 — forked from antonbabenko/cors.inc
(nginx AND varnish) + CORS (working example)
View cors.inc
more_set_headers "Access-Control-Allow-Origin: $http_origin";
more_set_headers "Access-Control-Allow-Credentials: true";
# OPTIONS indicates a CORS pre-flight request
if ($request_method = 'OPTIONS') {
more_set_headers "Access-Control-Max-Age: 1728000";
more_set_headers "Access-Control-Allow-Methods: GET, POST, PUT, DELETE, PATCH, OPTIONS";
more_set_headers "Access-Control-Allow-Headers: Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since";
more_set_headers "Content-Length: 0";
@ashim888
ashim888 / sane-caching.nginx.conf
Created Mar 26, 2018 — forked from philipstanislaus/sane-caching.nginx.conf
Sample Nginx config with sane caching settings for modern web development
View sane-caching.nginx.conf
# Sample Nginx config with sane caching settings for modern web development
#
# Motivation:
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools.
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh
# and juicy version of your assets available.
# At some point, however, you want to show your work to testers, your boss or your client.
# After you implemented and deployed their feedback, they reload the testing page – and report
# the exact same issues as before! What happened? Of course, they did not have developer tools
# open, and of course, they did not empty their caches before navigating to your site.
@ashim888
ashim888 / get_image_digitalocean.txt
Last active Aug 28, 2016
Get digitalocean ID from a packer build
View get_image_digitalocean.txt
packer build packer-install-template.json | tee output.txt
tail -1 output.txt | head -1 | awk 'match($0, / [0-9]+/) { print substr($0, RSTART, RLENGTH) }'
@ashim888
ashim888 / safety.py
Last active Jul 6, 2016
Child Safety Detection
View safety.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
from pymongo import MongoClient
import pprint
from nltk.corpus import stopwords
from nltk.tokenize import RegexpTokenizer
from microsofttranslator import Translator
import langid
porn_list=["anal","hentai","anus","arse","butt","arsehole","ass","fcuk","fuck","naked","xvideos","porn", "sex", "porno", "free porn", "porn tube", "porn videos", "streaming porn","Free porn", "sex videos","pussy","Porn hub", "xxx" "porn", "sex" ]
View summary_tool.py
# coding=UTF-8
from __future__ import division
import re
# This is a naive text summarization algorithm
# Created by Shlomi Babluki
# April, 2013
class SummaryTool(object):
@ashim888
ashim888 / frequency.py
Created Jul 14, 2014
frequency of the word "INTRO TO DATA SCIENCE" TWITTER FREQUENCY COUNT example
View frequency.py
from __future__ import division
fuckthis=[['This','fucker','bastard'],['fucker','ok','go','no'],['my','home','is','far'],['hey','you','fucker']]
#print len(fuckthis)
unique_list=[]
my_dict={}
def totalwords():
total_words=0
for x in range(0,len(fuckthis)):
for y in fuckthis[x]:
@ashim888
ashim888 / Rrandom
Created Jun 15, 2014
Random File Name Loop
View Rrandom
what<-function(id=1:333){
fileLocation<-paste(getwd(),"/",sep="")
for(i in id){
if(i<10){
fileName<-paste("00",id,".csv",sep="")
return(fileName)
}
else{
fileName<-paste("0",id,".csv",sep="")
return(fileName)
You can’t perform that action at this time.