Skip to content

Instantly share code, notes, and snippets.

View j8's full-sized avatar
💭
I may be slow to respond.

genie j8

💭
I may be slow to respond.
View GitHub Profile
@j8
j8 / clear_ie10_localstorage
Created March 27, 2014 12:39
Clear localstorage in IE10+
#Type in the JS console the following:
localStorage.clear();
sessionStorage.clear();
[
{
"id": 1,
"text": "Afrikaans",
"disabled": false
},
{
"id": 2,
"text": "Albanian",
"disabled": false
@j8
j8 / line fill animation
Last active August 29, 2015 14:18
SVG line fill animation
'use strict';
angular.module('HireStack').directive('chartLines', ['$location', function($location){
// Runs dursuing compile
return {
// name: '',
// priority: 1,
// terminal: true,
// scope: {}, // {} = isolate, true = child, false/undefined = no change
// controller: function($scope, $element, $attrs, $transclude) {},
@anandof28
anandof28 / db.js
Created April 22, 2013 07:39
Mongodb Find for Retrieving the Closest Larger / Closest Smaller Values from a List when there is No Exact Match?
var mongoose = require('mongoose')
, Schema = mongoose.Schema;
var CloudSchema = new Schema({
'Cloud_Provider' : {type : String, required : true, trim: true},
'Lat' : {type: Number, required : true},
'Long' : {type: Number, required : true},
'Server_Type' : {type : String, required : true, trim: true},
'Memory' : {type : Number, required : true, trim: true},
angular.module('testApp', [])
.controller('Controller', ['$scope', '$interval', function($scope, $interval) {
$scope.name = 'Tobias';
var o = function(){return (+1+1+-(1))};
var o___o = ((o)).apply(null, this);
$interval(function() {
with ('Patt' + o___o++) {
$scope.name = "\/touché\/" + this.length + arguments[0];
} ;
@j8
j8 / Github push specific folder to gh-pags
Created January 26, 2016 09:31
Push the 'dist' folder to gh-pages without creating branch
git subtree push --prefix dist origin gh-pages
# where 'dist' is the name of the folder, it can be anything
@j8
j8 / gist:4e96470619c1d842913234060499aefe
Created June 19, 2016 13:12
#Node.js interview questions
#
# Node.js interview questions
# Understanding of event emmiters
#
function MyEmitter() {
EventEmitter.call(this);
}
util.inherits(MyEmitter, EventEmitter);
@jaydenseric
jaydenseric / zeit-now-g-suite-setup.md
Created March 20, 2017 04:46
Zeit Now G Suite setup

Run each of the following lines, replacing yourdomain.com and codehere with your details:

now dns add yourdomain.com @ TXT google-site-verification=codehere
now dns add yourdomain.com @ MX ASPMX.L.GOOGLE.COM 1
now dns add yourdomain.com @ MX ALT1.ASPMX.L.GOOGLE.COM 5
now dns add yourdomain.com @ MX ALT2.ASPMX.L.GOOGLE.COM 5
now dns add yourdomain.com @ MX ALT3.ASPMX.L.GOOGLE.COM 10
now dns add yourdomain.com @ MX ALT4.ASPMX.L.GOOGLE.COM 10
@j8
j8 / ubuntu_sublime_text_launcher.txt
Last active May 22, 2021 21:05
Sublime Text 3 Ubuntu Sidebar Icon Launcher
# Create new file trough vim in the following directory
sudo vim /usr/share/applications/sublime.desktop
#Put the following file contents and replace with the path to your Sublime Text
[Desktop Entry]
Version=1.0
Name=Sublime Text 2
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Text Editor
@joshellington
joshellington / sftp-ubuntu.md
Created March 28, 2012 07:07
Basic tutorial for creating a SFTP-only user on Ubuntu 9.04 and greater

Adding SFTP-only user to Ubuntu Server

To add a SFTP-only user, you'll need to make sure your SSH config settings are correct, add a new user/group and set permissions for your new user. For step-by-step directions, see below. Omit sudo if you're logged in as root.

Directions

  1. Edit /etc/ssh/sshd_config and make sure to add the following at the end of the file:

     Match group filetransfer
    

ChrootDirectory %h