Skip to content

Instantly share code, notes, and snippets.

View longseespace's full-sized avatar
🎯
Focusing

Daniel Nguyen longseespace

🎯
Focusing
View GitHub Profile
#include "fpsitem.h"
#include <QElapsedTimer>
FPSItem::FPSItem(QQuickItem *parent)
: QQuickItem(parent)
, m_averageMsPerFrame(0)
{
setFlag(ItemHasContents);
}
@qknow-w
qknow-w / react-videojs-es6.js
Created August 28, 2016 12:55
react-videojs-es6
import React, {Component} from "react";
import cx from 'classnames';
import vjs from 'video.js';
import _ from 'lodash';
import ReactDOM from 'react-dom';
const DEFAULT_HEIGHT = "100%";
const DEFAULT_WIDTH = "100%";
const DEFAULT_ASPECT_RATIO = (9 / 16);
const DEFAULT_ADJUSTED_SIZE = 0;
@yoitsro
yoitsro / gist:8693021
Last active July 22, 2020 14:52
Node + Restify + Passport + Sessions + WebSockets
var restify = require('restify');
// Authentication
var passport = require('passport');
var LocalStrategy = require('passport-local').Strategy;
var sessions = require("client-sessions");
var server = restify.createServer();
server.use(restify.queryParser());
server.use(restify.bodyParser());
diff --git a/node_modules/react-native/scripts/react_native_pods.rb b/node_modules/react-native/scripts/react_native_pods.rb
index db9a34a..e95b882 100644
--- a/node_modules/react-native/scripts/react_native_pods.rb
+++ b/node_modules/react-native/scripts/react_native_pods.rb
@@ -165,7 +165,7 @@ def use_react_native_codegen!(spec, options={})
return if ENV['DISABLE_CODEGEN'] == '1'
# The path to react-native (e.g. react_native_path)
- prefix = options[:path] ||= File.join(__dir__, "..")
+ prefix = options[:path] ||= "../../node_modules/react-native"
@zhuowei
zhuowei / safariinject.m
Last active October 22, 2021 17:15
Restores old tab bar in Safari 15.0 (16612.1.29.41.4, 16612)
// Restores old tab bar in Safari 15.0 (16612.1.29.41.4, 16612)
// clang -fmodules -shared -Wall -Os -o libsafariinject.dylib safariinject.m
//
// If SIP off:
// DYLD_INSERT_LIBRARIES=$PWD/libsafariinject.dylib /Applications/Safari.app/Contents/MacOS/Safari
//
// If SIP on, you can demo this by manually removing Safari's code signing signature, but many
// features (eg saved logins) won't be readable by the resigned app:
// cp -a /Applications/Safari.app ./
// codesign --remove Safari.app/Contents/MacOS/Safari
@humblehacker
humblehacker / CVPixelBufferDeepCopy.swift
Last active February 13, 2022 20:35
Creates a deep copy of a CVPixelBuffer. Compatible with Swift 2.3.
extension CVPixelBuffer
{
/// Deep copy a CVPixelBuffer:
/// http://stackoverflow.com/questions/38335365/pulling-data-from-a-cmsamplebuffer-in-order-to-create-a-deep-copy
func copy() -> CVPixelBuffer
{
precondition(CFGetTypeID(self) == CVPixelBufferGetTypeID(), "copy() cannot be called on a non-CVPixelBuffer")
var _copy: CVPixelBuffer?
@YajanaRao
YajanaRao / serviceWorker.js
Last active October 15, 2022 10:10
serviceWorker.js file React Native Web
// This optional code is used to register a service worker.
// register() is not called by default.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on subsequent visits to a page, after all the
// existing tabs open on the page have been closed, since previously cached
// resources are updated in the background.
// To learn more about the benefits of this model and instructions on how to
@trungdq88
trungdq88 / paddle-revenue.js
Last active April 6, 2023 14:07
A scriptable's script to get Paddle revenue from multiple accounts using puppeteer.
/*
RUN THE SCRIPT BY YOURSELF:
- Run `node paddle-revenue.js` on your server and let it run 24/7.
- Access the API at http://your_server_ip:8175/ (JSON)
HOSTED VERSION:
If you don't want to run the script by your own, you can use the
hosted version. The price is $5 per month per Paddle account.
Here is how:
@kendellfab
kendellfab / goto-sublime
Created August 1, 2013 20:53
Add mouse click `goto definition` in sublime text 3.
Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User
Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User
Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User
[
{
"button": "button1",
"count": 1,
"modifiers": ["ctrl"],
"press_command": "drag_select",
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter