This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// g++ file_fixer.cpp --std=c++20 -O3 -o file_fixer | |
// usage: ./file_fixer file_to_fix file_ref_a file_ref_b .... | |
#include <string_view> | |
#include <iostream> | |
#include <span> | |
#include <vector> | |
#include <unistd.h> | |
#include <sys/mman.h> | |
#include <sys/stat.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <string_view> | |
#include <iostream> | |
#include <tuple> | |
std::tuple<std::u8string_view, char32_t> decode_u8_charpoint(std::u8string_view input) { | |
// XXX: silently accept invalid UTF8 | |
if ((input.at(0) & 0b10000000) == 0b00000000) { | |
return { | |
input.substr(1), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#include <iostream> | |
#include <type_traits> | |
#include <string> | |
#include <stdexcept> | |
#define FLATTEN __attribute__((flatten)) | |
#define INLINE __attribute__((always_inline)) | |
#define INLINE_FLATTEN __attribute__((always_inline, flatten)) | |
using size_t = std::size_t; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from '@ember/controller'; | |
import { action } from '@ember/object'; | |
import { inject as service } from '@ember/service'; | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
@service router; | |
@action async transition(route) { | |
try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//g++ test.cpp `sdl2-config --cflags --libs` -lGLEW -lGL | |
#define NO_SDL_GLEXT | |
#include <GL/glew.h> | |
#include <SDL2/SDL.h> | |
#include <stdexcept> | |
#include <iostream> | |
template<typename T> struct Vec2 { | |
T x; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://stackoverflow.com/questions/46234722/initialize-keras-placeholder-as-input-to-a-custom-layer | |
https://github.com/bckenstler/CLR | |
https://blog.evjang.com/2016/11/tutorial-categorical-variational.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.freepik.com/index.php?goto=2&k=patterns&isCat=1&isKeyword=1&type=1&vars=1&is_selection=1 | |
https://stackoverflow.com/a/44906668/362904 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
const events = [ | |
//keyboard | |
'keydown', | |
'keyup', | |
'keypress', | |
//im | |
'compositionstart', | |
'compositionupdate', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[rerender] { | |
transition: background 1s; | |
} | |
[rerender="2"] { | |
background: #ffd7d7 !important; | |
transition: background 0s; | |
} | |
[rerender="1"] { | |
background: #d7deff !important; | |
transition: background 0s; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function jsonToEmber(obj) { | |
if (obj instanceof Array) { | |
return Ember.A(obj.map(y => jsonToEmber(y))); | |
} else if (obj instanceof Object) { | |
let tmp = {}; | |
for (const x of Object.keys(obj)) { | |
if (obj[x] instanceof Array) { | |
tmp[x] = Ember.A(obj[x].map(y => jsonToEmber(y))); | |
} else if (obj[x] instanceof Object) { | |
tmp[x] = jsonToEmber(obj[x]); |
NewerOlder