Instantly share code, notes, and snippets.

View squareup.sh
convert $1 -resize 826x826^ -gravity center -crop 826x826+0+0 +repage -blur 0x8 temp.jpg
convert temp.jpg $1 -resize 826x -gravity center -composite -matte "./output/$1-out.jpg"
View angular-ios9-uiwebview.patch.js
/**
* ================== angular-ios9-uiwebview.patch.js v1.1.1 ==================
*
* This patch works around iOS9 UIWebView regression that causes infinite digest
* errors in Angular.
*
* The patch can be applied to Angular 1.2.0 – 1.4.5. Newer versions of Angular
* have the workaround baked in.
*
* To apply this patch load/bundle this file with your application and add a
View generate_ssl_cert
openssl genrsa -des3 -out config/topbox-ca-key.pem 1024
openssl req -new -key config/topbox-ca-key.pem -out config/topbox-ca.pem
openssl x509 -req -days 365 -in config/topbox-ca.pem -out config/topbox-ca-csr.pem -signkey config/topbox-ca-key.pem
openssl genrsa -des3 -out config/topbox-key.pem 1024
openssl req -new -key config/topbox-key.pem -out config/topbox-csr.pem
cp config/topbox-key.pem config/server.key.org
openssl rsa -in config/server.key.org -out config/topbox-key.pem
rm config/server.key.org
View gist:896b77b9f275b0e74a73
Please check all of the following points
Please check the following
Open SQL server Management Studio ,
1) Object Explorer -> Expand "Security" -> Right Click to create new User at SQL server and set all privileges for this user. (Right click on new user, select properties and we can get many options)
2)Right click on Server Instance->
A) Properties ->Security -> Select "SQL server and Windows Authentication Mode"
B) Properties ->Connections ->Select "Allow Remote connections to this server"
C) Properties ->Permissions-> Select created user and Grant Permissions
View script.js
summarySchema.statics.loadFull = function(options, callback){
var self = this;
self.findOne(options).populate([{
path: 'categories'
}])
.exec(function(err, res){
if(err || !res) return callback(err, res);
self.populate(res, [{
path: 'categories.questions',
model: 'Question'
View poem
'Twas the night before implementation and all through the house,
not a program was working not even a browse.
The programmers hung by their tubes in despair,
with hopes that a miracle would soon be there.
The users were nestled all snug in their beds,
while visions of inquiries danced in their heads.
When out in the machine room there arose such a clatter,
I sprang from my desk to see what was the matter.
View file_commands.sh
# Find all files less than 2kb
find /path/to/directory -type f -size -2k
# Find all text files less than 2kb
find /path/to/directory -type f -name '*.txt' -size -2k
# Find all files with given pattern and count them
find -type f -name '*.jpg' | wc -l
find -type f -name 'e_*' | wc -l
View closures.js
var a = 5;
function runMe(a){
assert( a == ___, "Check the value of a." );
function innerRun(){
assert( b == ___, "Check the value of b." );
assert( c == ___, "Check the value of c." );
}
var b = 7;
View rgolf.js
{
"Plain strings" : /foo/,
"Anchors" : /k$/,
"Ranges" : /^[a-f]+$/,
"Backrefs" : /(...).*\1/,
"Abba" : /^(?!.*(.)(.)\2\1)/,
"A man, a plan" : /^(.)[^p].*\1$/,
"Prime" : /^(?!(xx+)\1+$)/,
"Four" : /(.)(.\1){3}/,
"Order" : /^[^o].....?$/,
View .vimrc
" Akash Agrawal akashagrawal.me akagr[dot]outlook[dot]com
set nocompatible
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" External Bundles
" git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim
" add this to bashrc or bash_profile: export TERM="screen-256color"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
filetype off