Skip to content

Instantly share code, notes, and snippets.

View wiiiimm's full-sized avatar
:octocat:

wiIIimm wiiiimm

:octocat:
View GitHub Profile
@wiiiimm
wiiiimm / colorize.js
Created April 9, 2019 15:49
colorize.js
// https://30secondsofcode.org/node
module.exports = (...args) => ({
black: `\x1b[30m${args.join(' ')}`,
red: `\x1b[31m${args.join(' ')}`,
green: `\x1b[32m${args.join(' ')}`,
yellow: `\x1b[33m${args.join(' ')}`,
blue: `\x1b[34m${args.join(' ')}`,
magenta: `\x1b[35m${args.join(' ')}`,
@wiiiimm
wiiiimm / cloudbuild-deploy.yaml
Created February 16, 2019 02:46
Google Cloud Build with GitHub plugin
steps:
# Decrypt the file containing the key
- name: 'gcr.io/cloud-builders/gcloud'
args: ...
@wiiiimm
wiiiimm / ssh-key-generation.md
Created December 5, 2018 01:51 — forked from cybersamx/ssh-key-generation.md
Generate a new SSH key pair

Mac and Linux

  • Open Terminal

  • Check if you already have a SSH keypair generated. Do the following:

    $ ls -la ~/.ssh/id_rsa*
    

If the files exist, you already have SSH installed. IMPORTANT: But if you wish to regenerate the SSH key pair, at least back up your old SSH keys.

@wiiiimm
wiiiimm / Baidu TongJi + China Firewall = DDOS "Great Cannon"
Last active May 25, 2025 07:58
Baidu TongJi's Javascript Library (//hm.baidu.com/hm.js) Changes (by Firewall of China) to launch DDOS attack on enemy websites?
The Great Firewall of China seems to be hijacking Baidu Analytics (TongJi)'s Javascript code,
launching DDOS attacks on enemy websites from browsers.
Different hm.js (TongJi library) libraries are spotted and load interchangably.
An altered hm.js code is used when DDOS is observed.
More Info: https://stackoverflow.com/questions/45874555/baidu-tongji-analytics-is-directing-browsers-to-ddos-chinas-enemies
@wiiiimm
wiiiimm / easings.scss
Created August 3, 2017 11:07
Easings variables for SCSS
// taken from http://easings.net/
$ease-in-out-back: cubic-bezier(0.680, -0.550, 0.265, 1.550);
$ease-in-out-circ: cubic-bezier(0.785, 0.135, 0.150, 0.860);
$ease-in-out-expo: cubic-bezier(1.000, 0.000, 0.000, 1.000);
$ease-in-out-sine: cubic-bezier(0.445, 0.050, 0.550, 0.950);
$ease-in-out-quint: cubic-bezier(0.860, 0.000, 0.070, 1.000);
$ease-in-out-quart: cubic-bezier(0.770, 0.000, 0.175, 1.000);
$ease-in-out-cubic: cubic-bezier(0.645, 0.045, 0.355, 1.000);
$ease-in-out-quad: cubic-bezier(0.455, 0.030, 0.515, 0.955);
@wiiiimm
wiiiimm / hongkong_districts_ups.json
Last active June 16, 2022 08:28
102 Hong Kong Districts (UPS) in JSON with Traditional Chinese Translation
// UPS District and Codes for Hong Kong, extracted from UPS Shipping Package Developer Kit PDF
[
{
"name": "Aberdeen",
"translations": {
"zh": "香港仔"
},
"code": "SD1"
},
Router.route('/login', function () {
if (!Meteor.userId())
{
this.render('login', {
data: function(){
return {is_login: true};
}
});
<?php
$countries = array
(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;

Make it useful

  • Install Package Control. For SublimeText 2, paste the following in Terminal:
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

From here on out, use Package Control to install everything. +Shift+P, then type Install to get a list of installable packages you can 'livesearch through. After installing plugins, they should be running.