Skip to content

Instantly share code, notes, and snippets.

View Yonet's full-sized avatar
🎯
Focusing

Yönet Yonet

🎯
Focusing
View GitHub Profile
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
@revolunet
revolunet / angularjs.md
Last active October 22, 2021 00:36
BeerJS + AngularJS Paris le 25/2

AngularJS best ressources

Following the AngularJS PARIS meetup (25/2 à 19h à Paris with @sampaccoud @dzen @_kemar @tchack13 @vinz et @revolunet)

Here's our best AngularJS ressources : twitter, github, articles & blogs. Please comment and add your good stuff !

@Chocksy
Chocksy / nr_format.coffee
Created October 28, 2013 18:31
This is a simple angularjs filter that makes big numbers into short format. 1 milion becomes 1m and 1122 becomes 1.1k
@app = angular.module 'myApp', []
@app.filter "nrFormat", ->
(number) ->
if number!=undefined
console.log number
abs = Math.abs(number)
if abs >= Math.pow(10, 12)
# trillion
number = (number / Math.pow(10, 12)).toFixed(1)+"t"
else if abs < Math.pow(10, 12) and abs >= Math.pow(10, 9)
@joelhooks
joelhooks / gear.md
Last active April 2, 2024 20:18
Podcasting Gear List
@natelandau
natelandau / .bash_profile
Last active June 13, 2024 18:01
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@staltz
staltz / introrx.md
Last active June 21, 2024 12:27
The introduction to Reactive Programming you've been missing
@sybohy
sybohy / random_password.sh
Created July 17, 2014 01:17
OSX Bash Random Password Generator
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | env LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
echo $NEW_UUID
@ajaynitt
ajaynitt / TOP10.txt
Last active August 29, 2015 14:09
LeetCode Top 10 questions for Interview
After extensive data analysis of the votes from our beloved users,
we have released the Top 10 interview questions in Online Judge.
1. Median of Two Sorted Arrays
2. Valid Number
3. Pow(x, n)
4. Find Minimum in Rotated Sorted Array
5. Linked List Cycle
6. LRU Cache
7. Find Minimum in Rotated Sorted Array II
@bobbygrace
bobbygrace / trello-css-guide.md
Last active May 15, 2024 16:01
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@bvaughn
bvaughn / gist:012fb525e6c819fdc9bf
Last active May 23, 2016 15:01
Debugging Angular bindings

This afternoon I encountered a race condition in an Angular app I'm working on. Essentially my controller was pushing some values to an Array on its scope and something (I wasn't sure what) was asynchronously overriding the Array's contents. The Array was being used by a custom directive- written by someone else- as well as an ngModel and it wasn't clear who was making the change.

I ended up trying something I had not done before and it worked well enough that I thought I'd post it here in case it helped anyone else.

First I enabled The "Async" option in Chrome's "Sources > Call Stack" panel.

Next I set a breakpoint in my controller where I was modifying the Array. When I hit that breakpoint, I ran the following code in my console:

Object.observe(this.theArray, function(changes) {