Skip to content

Instantly share code, notes, and snippets.

View iniakunhuda's full-sized avatar
👨‍💻
Ancora Imparo!

Miftahul Huda iniakunhuda

👨‍💻
Ancora Imparo!
View GitHub Profile
@hallettj
hallettj / global-variables-are-bad.js
Created February 14, 2009 21:15
How and why to avoid global variables in JavaScript
// It is important to declare your variables.
(function() {
var foo = 'Hello, world!';
print(foo); //=> Hello, world!
})();
// Because if you don't, the become global variables.
(function() {
@jonathonbyrdziak
jonathonbyrdziak / jquery.class.js
Last active September 3, 2021 21:01
jQuery OOP Class: This allows you to easily create a class in Jquery.
/*!
* Simple JavaScript Inheritance
* By John Resig http://ejohn.org/
* MIT Licensed.
*
* Extended by Jonathon Byrd to include function hooks
* https://gist.github.com/Jonathonbyrd/724083
*
* Don't forget your Shims!
* https://github.com/kriskowal/es5-shim/blob/master
@danielestevez
danielestevez / gist:2044589
Last active July 26, 2024 08:30
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
@willread
willread / reverseWords.js
Created August 24, 2012 01:57
Reverse the words in a string
// Reverse words in a string
var reverseWords = function(sentence){
var words = sentence.split(" ").reverse(); // Split the sentence into an array of words and reverse it
var string = "";
for(word in words)
string += (word > 0 ? " " : "") + words[word]; // Concatenate each word to the output and add spaces where required
return string;
@rxaviers
rxaviers / gist:7360908
Last active July 27, 2024 17:59
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active July 19, 2024 01:24
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@marcelofabri
marcelofabri / cloudkit.swift
Last active September 7, 2022 09:51
CloudKit User Info
let container = CKContainer.defaultContainer()
container.fetchUserRecordIDWithCompletionHandler { (recordID, error) in
if !error {
println(recordID.recordName)
container.requestApplicationPermission(.PermissionUserDiscoverability) { (status, permissionError) in
if status == CKApplicationPermissionStatus.Granted {
container.discoverUserInfoWithUserRecordID(recordID) { (info, fetchError) in
println("\(info.firstName) \(info.lastName)")
}
}
@IzumiSy
IzumiSy / manifest.json
Last active November 6, 2022 20:29
Chrome.storage.sync example
{
"name": "SyncExtension",
"version": "0.1",
"manifest_version": 2,
"description": "Storage Sync Extension",
"permissions": [ "storage" ],
"browser_action": {
@PurpleBooth
PurpleBooth / README-Template.md
Last active July 27, 2024 07:37
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@alexcasalboni
alexcasalboni / dyslexia.js
Created March 4, 2016 11:15
Disyxela JS
// original: http://geon.github.io/programming/2016/03/03/dsxyliea
"use strict";
$(function(){
var getTextNodesIn = function(el) {
return $(el).find(":not(iframe)").addBack().contents().filter(function() {
return this.nodeType == 3;
});
};