Skip to content

Instantly share code, notes, and snippets.

View bulkan's full-sized avatar
🇯🇵

Savun Bulkan Evcimen bulkan

🇯🇵
View GitHub Profile
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
@bulkan
bulkan / js_fizzbuzz.js
Last active July 5, 2021 04:29
frontend fizzbuzz
// What does the following do ?
for(let i=0; i<=10; i++) {
fetch(`https://httpbin.org/get?someParam=${Date.now()}`)
.then(res => res.json())
.then(({origin}) => console.log(`${i} - ${origin}`));
}
@bulkan
bulkan / Dockerfile
Created August 19, 2018 23:32
Django sample Dockerfile
FROM python:3.6
ENV PYTHONUNBUFFERED 1
RUN groupadd -g 1001 -r django && useradd -m -u 1001 -r -g django django
WORKDIR /opt/project
USER root
ENV FILESYSTEM_ROOT /opt/project
COPY ./requirements.txt /opt/project/requirements.txt
RUN pip install pip --upgrade
LC_ALL=en_AU.UTF-8
LANG=en_AU.UTF-8
@bulkan
bulkan / heroku-anybar.js
Created May 9, 2018 07:51
show heroku ci status on anybar
const { exec } = require('child_process');
const anybar = require('anybar');
process.stdin.resume();
function exitHandler(err) {
if (err) {
console.error(err);
}
anybar('exclamation')
@bulkan
bulkan / jq.sh
Created March 6, 2018 23:45
example of munging JSON using jq and still getting valid JSON
#!/bin/bash
cat item.json | jq 'map( {
amount: .amount,
yieldFactor: .yieldFactor,
servingSize: .servingSize | { gramsEntered: .gramsEntered },
measures: .measures | map( {
amount: .amount,
gramsPerUnit: .gramsPerUnit
}),
@bulkan
bulkan / docker-cleanup.fish
Last active July 31, 2017 04:17
docker fish functions
function docker-cleanup --description "Drops unused and temporary images"
docker rm (docker ps -a -q -f status=exited)
docker rmi (docker images -q -f dangling=true)
end

Simple Example: Lets say you have a Students table, and a Lockers table.

Each student can be assigned to a locker, so there is a LockerNumber column in the Student table. More than one student could potentially be in a single locker, but especially at the beginning of the school year, you may have some incoming students without lockers and some lockers that have no students assigned.

For the sake of this example, lets say you have 100 students, 70 of which have lockers. You have a total of 50 lockers, 40 of which have at least 1 student and 10 lockers have no student.

INNER JOIN is equivalent to "show me all students with lockers". Any students without lockers, or any lockers without students are missing. Returns 70 rows

var webpack = require('webpack');
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
// basePath: '',
2015-04-04 12:49:16.812 Neovim[45982:2458045] *** Assertion failure in -[NSEvent clickCount], /SourceCache/AppKit/AppKit-1344.72/AppKit.subproj/NSEvent.m:1601
2015-04-04 12:49:16.812 Neovim[45982:2458045] Invalid message sent to event "NSEvent: type=ScrollWheel loc=(566,404) time=78107.4 flags=0x100 win=0x7fe263520840 winNum=2109 ctxt=0x0 deltaX=0.000000 deltaY=1.400085 deltaZ=0.000000 deviceDeltaX=0.000000 deviceDeltaY=1.000000 deviceDeltaZ=0.000000 count:0 phase=Changed momentumPhase=None"
2015-04-04 12:49:16.814 Neovim[45982:2458045] (
0 CoreFoundation 0x00007fff9a7c166c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff8cba176e objc_exception_throw + 43
2 CoreFoundation 0x00007fff9a7c144a +[NSException raise:format:arguments:] + 106
3 Foundation 0x00007fff8e65b3a9 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4 AppKit