Skip to content

Instantly share code, notes, and snippets.

@bergmannjg
bergmannjg / rearct-native-app-in-wsl2.md
Last active April 21, 2024 07:42
Building a react native app in WSL2
@javilobo8
javilobo8 / download-file.js
Last active April 9, 2024 12:01
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
//
// Base32.swift
// Created by Steve Streza on 26.9.14.
// Updated by Martin Troup on 4.11.16.
//
import Foundation
func Base32Encode(data: Data) -> String {
let alphabet = [ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "2", "3", "4", "5", "6", "7"]
return Base32Encode(data: data, alphabet: alphabet)
@maciekish
maciekish / resetXcode.sh
Created August 10, 2016 10:13
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches. You can thank me later.
#!/bin/bash
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
open /Applications/Xcode.app
@Daemon-Devarshi
Daemon-Devarshi / PasteboardWatcher.swift
Last active October 6, 2023 14:15
A class which performs polling to determine the newly copied url of desired kind in an external app
//
// PasteboardWatcher.swift
// PasteboardWatcher
//
// Created by Devarshi Kulshreshtha on 6/19/15.PasteboardWatcher
// Copyright © 2015 Devarshi Kulshreshtha. All rights reserved.
//
import Cocoa
@marocchino
marocchino / 094607.md
Last active July 19, 2022 14:25
ES6시대의 JavaScript

ES6시대의 JavaScript

안녕하세요. 사원사업부의 마루야마@h13i32maru입니다. 최근의 Web 프론트엔드의 변화는 매우 격렬해서, 조금 눈을 땐 사이에 점점 새로운 것이 나오고 있더라구요. 그런 격렬한 변화중 하나가 ES6이라는 차세대 JavaScript의 사양입니다. 이 ES6는 현재 재정중으로 집필시점에서는 Draft Rev31이 공개되어있습니다.

JavaScript는 ECMAScript(ECMA262)라는 사양을 기반으로 구현되어있습니다. 현재 모던한 Web 브라우저는 ECMAScript 5.1th Edition을 기반으로 한 JavaScript실행 엔진을 탑재하고 있습니다. 그리고 다음 버전인 ECMAScript 6th Edition이 현재 재정중으로, 약칭으로 ES6이라는 명칭이 사용되고 있습니다.

@masahirompp
masahirompp / User.ts
Last active May 5, 2021 20:04
mongoose + typescript
/// <reference path="../tsd/tsd.d.ts" />
import mongoose = require('mongoose');
import passport = require('passport');
interface IUser extends mongoose.Document {
provider: string;
id: string;
authorId: string;
displayName: string;
@drewis
drewis / colors.xml
Last active September 18, 2020 09:21
<?xml version="1.0" encoding="utf-8"?>
<!-- https://gist.github.com/kalehv/bae765c756e94455ed88 -->
<resources>
<color name="red_50">#ffebee</color>
<color name="red_100">#ffcdd2</color>
<color name="red_200">#ef9a9a</color>
<color name="red_300">#e57373</color>
<color name="red_400">#ef5350</color>
<color name="red_500">#f44336</color>
/*
* Copyright (C) 2014 sebnapi
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@staltz
staltz / introrx.md
Last active April 24, 2024 19:47
The introduction to Reactive Programming you've been missing