Skip to content

Instantly share code, notes, and snippets.

View raminious's full-sized avatar

Ramin Mo raminious

View GitHub Profile
@raminious
raminious / AppDelegate.m
Created April 12, 2022 12:56
react native AppDelegate.m
#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTAppSetupUtils.h>
#if RCT_NEW_ARCH_ENABLED
#import <React/CoreModulesPlugins.h>
@raminious
raminious / MainActivity.java
Created April 12, 2022 12:53
MainActivity.java
package com.rnexpo;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
@raminious
raminious / download.js
Created November 2, 2016 19:53
this snippet code should throw an error
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
@raminious
raminious / anti-if.js
Created December 30, 2015 12:16
Try to avoid if statement
var response = 4;
var api = {
dispatch: function(status){
var states = {
1: api.__err,
2: api.__err,
rm -rf $3
START=$(($(date +%s)*1000))
SILENT="-loglevel panic"
SILENT=""
# get video size
eval $(ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width $1)
size=${streams_stream_0_width}:${streams_stream_0_height}
@raminious
raminious / concat.bash
Created July 30, 2015 10:28
Concat two mp4 video files
#
# How to use
# ./concat main_video.mp4 prefix_video.mp4 output.mp4
#
#
rm -rf $3
SILENT="-loglevel panic"
SILENT=""
@font-face {
font-family: "nassim";
src: url('../fonts/nassim-regular.eot?1387626872');
src: url('../fonts/nassim-regular.eot?&1387626872#iefix') format('embedded-opentype'), url('../fonts/nassim-regular.woff?1387626920') format('woff'), url('../fonts/nassim-regular.ttf?1387626940') format('truetype');
font-weight: "normal";
font-style: "normal";
}
/*
* get user roles
*/
public function getRoles(){
$roles = array();
$sql = sprintf('select itemname from %s where userid = %d', Yii::app()->authManager->assignmentTable, Yii::app()->user->id);
//cache dependency